#include <stdio.h>

/* max size of every line */
#define MAXLINE		1024

/* relation with syntax */
#define SYNTAXNUM  6
#define PARENTHESES 0
#define BRACKETS    1
#define BRACES  2
#define QUOTES  3
#define DOUBLES  4
#define COMMENTS    5

int syntax[SYNTAXNUM];

void others(int);
void incomments(void);
void inquotes(int);
void indoubles(int);

int main()
{
	int c1, c2;

	for ( c1 = 0; c1 < SYNTAXNUM; ++c1 )
		syntax[c1] = 0;
	
	while ( c1 != EOF ) {

		/* whether is comments */
		if ( (c1=getchar()) == '/' ) {
			if ((c2=getchar()) == '*') {
				++syntax[COMMENTS];
				incomments();
			} else
				c1 = c2;
		}
		/* whether is quotes */
		else if ( c1 == '\'' ) {
			++syntax[QUOTES];
			inquotes(c2);
		}
		/* whether is doubles */
		else if ( c1 == '\"' ) {
			++syntax[DOUBLES];
			indoubles(c2);
		}
		/* whether is parentheses or brackets or braces */
		else {
			others(c1);
			others(c2);
		}
	}

	if ( syntax[PARENTHESES] > 0 )
		printf("Unmatched parentheses\n");
	if ( syntax[BRACKETS] > 0 )
		printf("Unmatched brackets\n");
	if ( syntax[BRACES] > 0 )
		printf("Unmatched braces\n");
	if ( syntax[COMMENTS] > 0 )
		printf("Unmatched comments\n");
	if ( syntax[QUOTES] > 0 )
		printf("Unmatched quotes\n");
	if ( syntax[DOUBLES] > 0 )
		printf("Unmatched doubles\n");

	return 0;
}

void others(int c)
{
	if ( c == '{' )
		++syntax[PARENTHESES];
	if ( c == '}' )
		--syntax[PARENTHESES];
	if ( c == '[' )
		++syntax[BRACES];
	if ( c == ']' )
		--syntax[BRACES];
	if ( c == '(' )
		++syntax[BRACKETS];
	if ( c == ')' )
		--syntax[BRACKETS];
}

void incomments()
{
	int c1, c2;

	while ( c1 != EOF ) {
		if ( (c1=getchar()) == '*') {
			if ( (c2=getchar()) == '/') {
				--syntax[COMMENTS];
				break;
			} else
				c1 = c2;
		}
	}
}

void inquotes(int c)
{

	if ( c == '\'' ) {
		--syntax[QUOTES];
		return;
	}

	while ((c=getchar()) != EOF ) {

		if ( c == '\\') {
			getchar();
			c = getchar();
		}

		if ( c == '\'' ) {
			--syntax[QUOTES];
			break;
		}
	}
}

void indoubles(int c)
{

	if ( c == '\"' ) {
		--syntax[DOUBLES];
		return;
	}

	while ((c=getchar()) != EOF ) {

		if ( c == '\\') {
			getchar();
			c = getchar();
		}

		if ( c == '\"' ) {
			--syntax[DOUBLES];
			break;
		}
	}
}
